package com.ruoyi.hospital.service.storeInfo.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.storeInfo.StoreUserMapper;
import com.ruoyi.hospital.domain.storeInfo.StoreSysUser;
import com.ruoyi.hospital.service.storeInfo.IStoreUserService;

/**
 * 药店用户Service业务层处理
 * 
 * @author wendao
 * @date 2024-09-18
 */
@Service
public class StoreUserServiceImpl implements IStoreUserService
{
    @Autowired
    private StoreUserMapper storeUserMapper;

    /**
     * 查询药店用户
     * 
     * @param userId 药店用户主键
     * @return 药店用户
     */
    @Override
    public StoreSysUser selectStoreSysUserByUserId(Integer userId)
    {
        return storeUserMapper.selectStoreSysUserByUserId(userId);
    }

    /**
     * 查询药店用户列表
     * 
     * @param storeSysUser 药店用户
     * @return 药店用户
     */
    @Override
    public List<StoreSysUser> selectStoreSysUserList(StoreSysUser storeSysUser)
    {
        return storeUserMapper.selectStoreSysUserList(storeSysUser);
    }

    /**
     * 新增药店用户
     * 
     * @param storeSysUser 药店用户
     * @return 结果
     */
    @Override
    public int insertStoreSysUser(StoreSysUser storeSysUser)
    {
        storeSysUser.setCreateTime(DateUtils.getNowDate());
        return storeUserMapper.insertStoreSysUser(storeSysUser);
    }

    /**
     * 修改药店用户
     * 
     * @param storeSysUser 药店用户
     * @return 结果
     */
    @Override
    public int updateStoreSysUser(StoreSysUser storeSysUser)
    {
        storeSysUser.setUpdateTime(DateUtils.getNowDate());
        return storeUserMapper.updateStoreSysUser(storeSysUser);
    }

    /**
     * 批量删除药店用户
     * 
     * @param userIds 需要删除的药店用户主键
     * @return 结果
     */
    @Override
    public int deleteStoreSysUserByUserIds(Integer[] userIds)
    {
        return storeUserMapper.deleteStoreSysUserByUserIds(userIds);
    }

    /**
     * 删除药店用户信息
     * 
     * @param userId 药店用户主键
     * @return 结果
     */
    @Override
    public int deleteStoreSysUserByUserId(Integer userId)
    {
        return storeUserMapper.deleteStoreSysUserByUserId(userId);
    }
}
